package com.ftg.learn.javabase;

import com.ftg.learn.demo.Elephant;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import javax.swing.*;

/**
 * @author kangjx
 * @createTime 2022/8/15
 */
public class Demo {

    public static void main(String[] args) {
        //底层是newiNSTANCE  beanfactory
        AnnotationConfigApplicationContext beanFactory = new AnnotationConfigApplicationContext("com.ftg.learn.javabase");

        Cat cat = (Cat) beanFactory.getBean("cat");

        Cat cat1 = beanFactory.getBean(Cat.class);

    }

}
